export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'nuxt-project',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
    ],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
  },
  // loading config
  loading: {
    color: '#40a9ff',
    height: '2px',
  },
  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    'ant-design-vue/dist/antd.less',
    '~assets/css/u-flex.css',
    '~assets/css/u-base.css',
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    '@/plugins/antd-ui',
    { src: '~/plugins/store-cache', ssr: false },
    '@/plugins/components',
    '@/plugins/request',
    { src: '~plugins/vueLazyLoad', ssr: false },
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
    // https://go.nuxtjs.dev/typescript
    '@nuxt/typescript-build',
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
    // https://go.nuxtjs.dev/pwa
    '@nuxtjs/pwa',
    '@nuxtjs/style-resources',
  ],
  styleResources: { less: ['./assets/css/u-variable.less'] },
  // Axios module configuration: https://go.nuxtjs.dev/config-axios
  // axios: {
  //   proxy: true
  // },
  // proxy: {
  //   '/api/': 'https://www.jianshu.com'
  // },
  // PWA module configuration: https://go.nuxtjs.dev/pwa
  pwa: {
    manifest: {
      lang: 'en',
    },
  },
  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    loaders: {
      less: {
        javascriptEnabled: true,
        modifyVars: {
          'primary-color': 'green',
        },
      },
    },
  },
  // server config
  server: {
    port: 8090, // default: 3000,修改为8090
    host: 'localhost', // default: localhost
  },
}
